// -*- coding: utf-8 -*- 
/**
 * Project: Java8InActionT
 *
 * @author: yanking
 * Create time: 2022-03-19 19:24
 * IDE: IntelliJ IDEA
 * Introduction:
 */
package com.LambdTest;

import org.junit.jupiter.api.Test;

import java.nio.channels.Pipe;
import java.util.Arrays;
import java.util.List;
import java.util.stream.IntStream;

import static com.referenceFunc.Apple.filter;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class Point {
    private int x;
    private int y;

    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public Point moveRightBy(int x) {
        return new Point(this.x + x, this.y);
    }

    @Test
    public void shout() {
        Point p1 = new Point(5, 5);
        Point p2 = p1.moveRightBy(10);
        assertEquals(15, p2.getX());
        assertEquals(5, p2.getY());
    }


    public static void main(String[] args) {
        IntStream.of(1, 2, 3, 4, 5, 6).peek(a -> System.out.print(a + "\t")).map(a -> a + 1).forEach(System.out::println);
    }


}
